package com.cskaoyan.wordmemorize.controller.app;


import com.cskaoyan.wordmemorize.common.result.Result;
import com.cskaoyan.wordmemorize.dto.admin.GoodsDTO;
import com.cskaoyan.wordmemorize.dto.admin.PageDTO;
import com.cskaoyan.wordmemorize.request.GoodsPageRequest;
import com.cskaoyan.wordmemorize.request.PageRequest;
import com.cskaoyan.wordmemorize.service.GoodsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "移动端-商品模块")
@RestController
public class GoodsProductController {
    @Resource
    GoodsService goodsService;
    //获取所有的商品数据
    @GetMapping("product")
    public Result<PageDTO<GoodsDTO>> getAllGoodsProducts(GoodsPageRequest pageRequest){
        PageDTO<GoodsDTO> goodsPage = goodsService.getGoodsPage(pageRequest);
        return Result.ok(goodsPage);
    }
}
